<?php
class users extends Zmodel{

	function get_user_group(){
            $this->load->database();
            $sql="SELECT * FROM user_group";
            $usergroup=$this->db->query($sql);
            return $usergroup->result();
    }
     function get_users(){
            $this->load->database();
            $sql="SELECT * FROM users";
            $user=$this->db->query($sql);
            return $user->result();
    }
    function authentication($username,$upwd){
            $this->load->database();
            $sql = "SELECT * FROM users WHERE user_login='".$username."' AND user_pwd='".$upwd."'";
            $query = $this->db->query($sql);
            if ($query->num_rows() <= 0) {
                return null;
            } else {
            	return $query->result();
            }
    }
    


}

?>